package io.rong.callkit.huke;

import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;

import de.hdodenhof.circleimageview.CircleImageView;
import io.rong.callkit.R;
import io.rong.callkit.huke.Bean.UserInfo;

/**
 * @创建者 喻亚龙
 * @描述
 */

public class SingleCallBackActivity extends Activity{
    private CircleImageView iv_portrait;
    private TextView tv_age;
    private TextView tv_time;
    private TextView tv_gold;
    private ImageView iv_sex;
    private ImageView iv_back;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.rc_voip_activity_single_call_back);


        String time = getIntent().getStringExtra("TIME");
        long gold = getIntent().getLongExtra("GOLD",0);
        boolean isCall = getIntent().getBooleanExtra("ISCALL",false);
        iv_portrait = (CircleImageView) findViewById(R.id.iv_portrait);
        tv_age = (TextView) findViewById(R.id.tv_age);
        tv_time = (TextView) findViewById(R.id.tv_time);
        tv_gold = (TextView) findViewById(R.id.tv_gold);
        iv_sex = (ImageView) findViewById(R.id.iv_sex);
        iv_back = (ImageView) findViewById(R.id.iv_back);

        UserInfo userInfo = AccountHelper.getUser();

        tv_age.setText(userInfo.getAge()+"");
        if (isCall){
            tv_gold.setText("-"+gold+"金币");
        }else {
            tv_gold.setText("+"+gold+"金币");
        }
        tv_time.setText(time+"");
        RequestOptions options = new RequestOptions()
                .centerCrop()
                .placeholder(R.drawable.widget_default_face)
                .error(R.drawable.widget_default_face);
        Glide.with(this).asBitmap().load(userInfo.getIcon()).apply(options).into(iv_portrait);

        iv_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });



    }
}
